<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head jwcid="@Head" includeJs="upc/js/ajaxfileupload.js">
</head>
<body jwcid="@Body">
	<div class="m_wrapper">
		<div class="m_wrapper2">
			<!-- 区域 开始 -->

			<div class="c_box">
				<div class="c_title">
					<div class="text">需求详情</div>
					<div class="fn">
						<a class="file" upload="fileupload" onclick="javascript:;"><i
							class="e_ico-upload"></i>上传附件 <input class="e_attach" type="file"
							multitype jwcid="@Any"
							listener='upload' onchange="upload($(this));" needRefresh="false"
							param="ognl:'taskId='+newTaskId" name="fileupload"
							id="fileupload" /> </a>
					</div>
				</div>

				<div class="c_form c_form-col-3 c_form-label-5 c_form-inline"
					jwcid="configTaskInfo@Part" uiid="configTaskInfo"
					id="configTaskInfo" type="form" objName="configTaskInfo"
					template_type="configTaskInfo" style="">
					<ul class="ul">
						<li class="li"><span class="label label-info"><span
								class="e_required">需求ID：</span></span> <span class="e_input"><span><input
									type="text" name="taskId" id="taskId" jwcid="@TextField"
									value="ognl:newTaskId" desc="任务Id" readonly="true" /></span></span></li>
						<li class="li">
							<span class="label label-info">
								<span class="e_required">需求标题：</span>
							</span> 
							<span class="e_input">
								<span><input type="text" name="taskName" id="taskName" jwcid="@TextField" value="ognl:condForm.taskName" desc="需求标题" nullable="no" /></span>
							</span>
						</li>
									
						<li class="li"><span class="label label-info"><span
								class="e_required">BOMC工单：</span></span> <span class="e_input"><span><input
									type="text" name="taskSrc" id="taskSrc" jwcid="@TextField" 
									value="ognl:condForm.taskSrc" desc="需求来源" nullable="no" /></span></span></li>
									
						<li class="li"><span class="label label-info"><span
								class="e_required">需求流程：</span></span> <span class="e_select"><span><span>
										<select jwcid="@Select" id="flowId" name="flowId"
										textField="flowName" valueField="flowId"
										source="ognl:getAllFlows()" value="1" nullable="no">
									</select><!--  onchange="changeFlow($(this));" -->
								</span></span></span></li>
								<!-- source="ognl:getGroupMember(1001,'')" -->
						<li class="li"><span class="label label-info"><span
								class="e_required">接口人：</span></span> <span class="e_select"><span><span>
										<select jwcid="@Select" id="staffId" name="staffId"
										textField="code" valueField="operatorId" changevalue="true"
										source="ognl:getGroupMember(1001,'')" value="ognl:currentOpId"
										nullable="no">
									</select>
								</span></span></span></li>


						<li class="li col-3"><span class="label"><span
								class="e_required">需求说明：</span></span> <span class="e_textarea">
								<span class="e_textareaTop"><span></span></span> <span
								class="e_textareaContent"><textarea jwcid="@TextArea"
										name="taskContent" id="taskContent"
										value="ognl:condForm.taskContent" desc="需求说明" nullable="no"></textarea></span>
								<span class="e_textareaBottom"><span></span></span>
						</span></li>
					</ul>
				</div>
				<input jwcid="@Any" id="currentNodeId" name="currentNodeId" type="hidden" />
				<div jwcid="@Any" id="operPart">
					<div class="c_submit">
						<button class="e_button-page e_button-page-ok"
							onclick="return addWorkOrderInfos($(this));">
							<i></i><span>保存</span>
						</button>
					</div>
				</div>
			</div>
			
			<!-- 自己测试区域 开始1 -->
			<div class="c_box"
				jwcid="QueryPart@Part" 
				id="QueryPart" 
				element="div">
				<!-- 显示文字测试 -->
				<div jwcid="@Insert" value="ognl: dzText" class="e_required"></div>
			</div>


				<!-- 自己测试区域 开始2 -->
			<div class="c_box">
				<!-- 显示列表 -->
				<div jwcid="@Foreach" source="ognl:customerList" value="ognl:customer" style="display: block; float: left;">
					<div jwcid="@Insert" value="ognl:customer.id" style="display: block; float: left; width: 30px;"></div>
					<div jwcid="@Insert" value="ognl:customer.name" style="display: block; float: left; width: 30px;"></div>
				</div>
				
			</div>

			<!-- 自己测试区域 开始3 -->
			<div class="c_box">
				<div class="c_form c_form-col-3 c_form-label-5 c_form-inline"
					jwcid="testInfo@Part" uiid="testInfo"
					id="testInfo" type="form" objName="testInfo" template_type="testInfo">
					<ul class="ul">
						<li class="li">
							<span class="label label-info">
								<span class="e_required">id</span>
							</span> 
							<span class="e_input">
								<span><input type="text" name="testId" id="testId" jwcid="@TextField" value="ognl:testInfo.testId" desc="测试ID" nullable="no" /></span>
							</span>
						</li>
						<li class="li">
							<span class="label label-info">
								<span class="e_required">name：</span>
							</span> 
							<span class="e_input">
								<span><input type="text" name="testName" id="testName" jwcid="@TextField" value="ognl:testInfo.testName" desc="测试姓名" nullable="no" /></span>
							</span>
						</li>
					</ul>
				</div>

				<div jwcid="@Any" id="operPart">
					<div class="c_submit">
						<button class="e_button-page e_button-page-ok"
							onclick="return addTestInfo($(this));">
							<i></i><span>保存</span>
						</button>
					</div>
				</div>
			</div>


			

		</div>
	</div>

</body>
<script type="text/javascript">
	function addWorkOrderInfos(obj) {

		if ($.validate.verifyAll("configTaskInfo")) {
			//  ajaxSubmit("configTaskInfo","addWorkOrderInfo","",null,function(data){
			$.ajax.submit("configTaskInfo", "addWorkOrderInfo", null, null,
				function(data) {

					MessageBox.success("操作成功", data.get("operateResult",
							"创建成功"), refreshWindow);
					//window.parent.$.navtabset.closeAll();
				}, function(e, i) {

					alert(i);
				}, {
					async : false
				});
		}
	}
		
	function refreshWindow() {
		window.parent.$.navmenu.loadShortCutMenu();
		window.parent.$.navtabset.closeAll();
	}		

	function selectOper() {
		javascript: popupPageExternal('upc.StaffQuery', 'init', '', '选择员工',
				680, 450, 'staffId');
	}
	
	function changeFlow(obj){
		var flowId = obj.val();
		if(flowId != ""){
		$.ajax.submit("configTaskInfo", "getFlow", "flowId="+flowId, null, function(
				data) {
			$("#staffId").attr("source","ognl:getGroupMember(" + data.get("groupId","0") + ", '')");

		}, function(e, i) {

			alert(i);
		}, {
			async : false
		});	
		}
	}
	
	 function addTestInfo(obj) {
		 if ($.validate.verifyAll("testInfo")) {
			 console.log(obj);
			 console.log("success");
			 $.beginPageLoading();
			 $.ajax.submit("testInfo", "addTestInfo", null, "QueryPart",
			     function() {
				 	$.endPageLoading();
				 },
				 function() {
					 $.endPageLoading();
				 }
			 )
	 	 } else {
		 	console.log(obj);
		 	console.log("error");
	 	 }
	 }

</script>
</html>
